/**
 * creater:chuanpeng.zhu
 * create time:2016/05/27
 * describe：用户操作服务。用于用户信息的存储。调用等。
 **/
/*接口地址管理 */
APP
  .service('UrlService', [function () {
    var servers = [
      {//开发环境
        dataServer: 'http://localhost:8100',
        imageServer: 'http://172.16.63.99:3000',
        uploadImageServer: 'http://172.16.63.99:3000/uploadImage',
        payServer: ''
      }, {//开发调试环境
        dataServer: 'http://172.24.1.119:8089',
        imageServer: 'http://172.24.1.119:8089',
        uploadImageServer: 'http://172.24.1.119:8089',
        payServer: ''
      }, {//测试环境
        dataServer: '',
        imageServer: '',
        uploadImageServer: '',
        payServer: ''
      }, {//生产环境
        dataServer: 'http://xiaohui.safebox.net.cn',
        imageServer: 'http://xiaohui.safebox.net.cn',
        uploadImageServer: 'http://xiaohui.safebox.net.cn',
        payServer: ''
      }];

    var urls = [{
      /* 登录 START */
      LOGIN: '/data/Login.json', //首页获取轮播广告列表
      DEFAULT_IMAGE: '/example/defaultImage', //首页获取轮播广告列表
      GET_BACK_PASSWORD: '/user',//首页获取轮播广告列表
      REGISTER: '/user',//注册
      HOME_INIT: '/home',//首页获取轮播广告列表
      GET_LOCUS:'/data/Locus.json'
      /* 登录 END */
    }, {
      /* 登录 START */
      LOGIN: '/security/login.ajax', //登陆
      LOGOUT: '/security/loginOut.ajax', //注销
      GET_EMAIL: '/user/getUserEmail.ajax', //获取绑定邮箱
      ALARM_SETTING: '/binderInfo/AlertUnTakeDeviceSet.ajax', //报警设置
      ALARM_SETTING_INIT: '/binderInfo/getAlertUnTakeSet.ajax', //报警设置获取
      FEEDBACK_LIST: '/feedback/feedBackList.ajax', //意见反馈列表
      FEEDBACK_ADD: '/feedback/addFeedBack.ajax', //意见反馈新增
      EMAIL_CHECK_CODE: '/getPhone/getEmailCheckCode.ajax', //发送获取Eamil验证码
      PHONE_CHECK_CODE: '/getPhone/getPhoneCheckCode.ajax', //发送获取Phone验证码
      CHECK_CODE: '/getPhone/overViewCheckCode.ajax', //校验验证码
      UPDATE_PASSWORD: '/user/updatePassword.ajax', //修改密码
      RESET_PASSWORD: '/user/resetPassword.ajax', //重置密码
      USER_MESSAGE: '/user/getUserMessage.ajax', //获取用户信息
      CHANGE_USER_MESSAGE: '/user/changeUserMessage.ajax', //修改用户信息
      CON_CHANGE_USER_MESSAGE: '/user/firmChangeUserMessage.ajax', //确认修改用户信息
      ACTION_REPORT: '/getActionReport/sportData.ajax', //确认修改用户信息
      SELECTRIC_FENCE_LIST: '/getPhone/selectricFence.ajax', //电子围栏列表
      DELETE_FENCE_LIST: '/getPhone/deleatFence.ajax', //删除电子围栏列表
      SELECTRIC_FENCE_ADD: '/getPhone/addElectricFence.ajax', //电子围栏添加
      DEFAULT_IMAGE: '/example/defaultImage', //首页获取轮播广告列表
      GET_BACK_PASSWORD: '/user',//首页获取轮播广告列表
      REGISTER: '/user/register.ajax',//注册
      GETPCRMESSAGE:'/getPhone/getPCRmessage.ajax',//获取省市区
      GETSCHOOLMESSAGE:'/getPhone/getSchoolMessage.ajax',//获取学校信息
      UNBIND:'/deviceUser/unbind.ajax',//解除绑定
      BINDERMANAGERCHECK : '/binderInfo/binderManagerCheck.ajax',//绑定人管理审核
      BINDERMANAGERCHECKLIST : '/binderInfo/binderManagerCheckList.ajax',//绑定人管理待审核列表
      CHECKDEVICECODE : '/schoolBadgeList/checkDeviceCode.ajax',//校验设备号
      ADDBINDER :'/deviceUser/insertBinder.ajax',//添加绑定人
      BINDERDETAIL : '/deviceUser/binderDetail.ajax',//绑定人详情
      EDITBINDER : '/deviceUser/editBinder.ajax',//编辑绑定人
      SAVEDEVICE : '/deviceUser/saveCode.ajax',//保存设备
      EXITCLASS : '/deviceUser/leaveClass.ajax',//退出班级
      GETUNREADMESSAGE : '/message/messageStatue.ajax',//获取未读报警消息
      WARNININGMESSAGE:'/message/alertMessageList.ajax',//报警消息列表
      UPDATESTATE : '/message/updateReadState.ajax',//未读消息变已读
      SYSTEMMESSAGE : '/systemMessage/systemMessageList.ajax',//系统消息列表
      MESSAGEDELETE : '/message/messageDetele.ajax',//删除消息
      USERBUSINESSMESSAGELIST : '/businessMessage/userBusinessMessageList.ajax',//消息首页－用户业务消息列表
      USERSENDMESSAGELIST :'/businessMessage/userSendmessageList.ajax',//业务消息－我发送的消息列表
      USERSENDMESSAGEDETAIL:'/businessMessage/userSendmessageDetail.ajax',//业务消息－我发送的消息详情
      USERGETMESSAGELIST : '/businessMessage/userGetMessageList.ajax',//业务消息－我收到的业务消息列表
      USERGETMESSAGEDETAIL:'/businessMessage/userGetMessageDetail.ajax',//业务消息－我收到的业务消息详情
      USERGERMESSAGEDETAILHANDLE : '/businessMessage/userGetMessageDetailHandle.ajax',//业务消息－我收到的业务消息处理
      HOME_INIT: '/home',//首页获取轮播广告列表
      /* 登录 END */
      /***** zzq start******/
      ACCESSLIST:'/getPhone/accessList.ajax',
      ADDACCESS:'/getPhone/accessAdd.ajax',
      DETELEACCESS:'/getPhone/accessDelete.ajax',
      EDITACCESS:'/getPhone/accessEdit.ajax',
      MESSAGESTATUE:'/message/messageStatue.ajax',
      MESSAGEPEOPLE:'/message/messagePersonList.ajax',
      GETALLBINDERLIST:'/deviceUser/getAllBinderlist.ajax',
      GETBINDERPLACE:'/binderInfo/getBinderPlace.ajax',
      GETBINDERPLACEBYGEO:'/binderInfo/getBinderPlaceByGeo.ajax',
      DEVICEMANAGER:'/schoolBadgeList/deviceControl.ajax',
      GETMESSAGEPERLIST:'/businessMessage/messagePersonList.ajax',
      GET_LOCUS:'/getActionReport/playbackTrack.ajax',
      CREATEDITMESSAGEDETAIL:'/businessMessage/userCreatEditMessageDetail.ajax',
      CREATEDEDITMESSAGE:'/businessMessage/userCreatEditMessage.ajax',
      GET_WXMESSAGE:'/weixin/getWXSignMessage.ajax',
      GET_WXOPENID:'/weixin/getOpenId.ajax'

    },{},{

      /* 登录 START */
      LOGIN: '/security/login.ajax', //登陆
      LOGOUT: '/security/loginOut.ajax', //注销
      GET_EMAIL: '/user/getUserEmail.ajax', //获取绑定邮箱
      ALARM_SETTING: '/binderInfo/AlertUnTakeDeviceSet.ajax', //报警设置
      ALARM_SETTING_INIT: '/binderInfo/getAlertUnTakeSet.ajax', //报警设置获取
      FEEDBACK_LIST: '/feedback/feedBackList.ajax', //意见反馈列表
      FEEDBACK_ADD: '/feedback/addFeedBack.ajax', //意见反馈新增
      EMAIL_CHECK_CODE: '/getPhone/getEmailCheckCode.ajax', //发送获取Eamil验证码
      PHONE_CHECK_CODE: '/getPhone/getPhoneCheckCode.ajax', //发送获取Phone验证码
      CHECK_CODE: '/getPhone/overViewCheckCode.ajax', //校验验证码
      UPDATE_PASSWORD: '/user/updatePassword.ajax', //修改密码
      RESET_PASSWORD: '/user/resetPassword.ajax', //重置密码
      USER_MESSAGE: '/user/getUserMessage.ajax', //获取用户信息
      CHANGE_USER_MESSAGE: '/user/changeUserMessage.ajax', //修改用户信息
      CON_CHANGE_USER_MESSAGE: '/user/firmChangeUserMessage.ajax', //确认修改用户信息
      ACTION_REPORT: '/getActionReport/sportData.ajax', //确认修改用户信息
      SELECTRIC_FENCE_LIST: '/getPhone/selectricFence.ajax', //电子围栏列表
      DELETE_FENCE_LIST: '/getPhone/deleatFence.ajax', //删除电子围栏列表
      SELECTRIC_FENCE_ADD: '/getPhone/addElectricFence.ajax', //电子围栏添加
      DEFAULT_IMAGE: '/example/defaultImage', //首页获取轮播广告列表
      GET_BACK_PASSWORD: '/user',//首页获取轮播广告列表
      REGISTER: '/user/register.ajax',//注册
      GETPCRMESSAGE:'/getPhone/getPCRmessage.ajax',//获取省市区
      GETSCHOOLMESSAGE:'/getPhone/getSchoolMessage.ajax',//获取学校信息
      UNBIND:'/deviceUser/unbind.ajax',//解除绑定
      BINDERMANAGERCHECK : '/binderInfo/binderManagerCheck.ajax',//绑定人管理审核
      BINDERMANAGERCHECKLIST : '/binderInfo/binderManagerCheckList.ajax',//绑定人管理待审核列表
      CHECKDEVICECODE : '/schoolBadgeList/checkDeviceCode.ajax',//校验设备号
      ADDBINDER :'/deviceUser/insertBinder.ajax',//添加绑定人
      BINDERDETAIL : '/deviceUser/binderDetail.ajax',//绑定人详情
      EDITBINDER : '/deviceUser/editBinder.ajax',//编辑绑定人
      SAVEDEVICE : '/deviceUser/saveCode.ajax',//保存设备
      EXITCLASS : '/deviceUser/leaveClass.ajax',//退出班级
      GETUNREADMESSAGE : '/message/messageStatue.ajax',//获取未读报警消息
      WARNININGMESSAGE:'/message/alertMessageList.ajax',//报警消息列表
      UPDATESTATE : '/message/updateReadState.ajax',//未读消息变已读
      SYSTEMMESSAGE : '/systemMessage/systemMessageList.ajax',//系统消息列表
      MESSAGEDELETE : '/message/messageDetele.ajax',//删除消息
      USERBUSINESSMESSAGELIST : '/businessMessage/userBusinessMessageList.ajax',//消息首页－用户业务消息列表
      USERSENDMESSAGELIST :'/businessMessage/userSendmessageList.ajax',//业务消息－我发送的消息列表
      USERSENDMESSAGEDETAIL:'/businessMessage/userSendmessageDetail.ajax',//业务消息－我发送的消息详情
      USERGETMESSAGELIST : '/businessMessage/userGetMessageList.ajax',//业务消息－我收到的业务消息列表
      USERGETMESSAGEDETAIL:'/businessMessage/userGetMessageDetail.ajax',//业务消息－我收到的业务消息详情
      USERGERMESSAGEDETAILHANDLE : '/businessMessage/userGetMessageDetailHandle.ajax',//业务消息－我收到的业务消息处理
      HOME_INIT: '/home',//首页获取轮播广告列表
      /* 登录 END */
      /***** zzq start******/
      ACCESSLIST:'/getPhone/accessList.ajax',
      ADDACCESS:'/getPhone/accessAdd.ajax',
      DETELEACCESS:'/getPhone/accessDelete.ajax',
      EDITACCESS:'/getPhone/accessEdit.ajax',
      MESSAGESTATUE:'/message/messageStatue.ajax',
      MESSAGEPEOPLE:'/message/messagePersonList.ajax',
      GETALLBINDERLIST:'/deviceUser/getAllBinderlist.ajax',
      GETBINDERPLACE:'/binderInfo/getBinderPlace.ajax',
      GETBINDERPLACEBYGEO:'/binderInfo/getBinderPlaceByGeo.ajax',
      DEVICEMANAGER:'/schoolBadgeList/deviceControl.ajax',
      GETMESSAGEPERLIST:'/businessMessage/messagePersonList.ajax',
      GET_LOCUS:'/getActionReport/playbackTrack.ajax',
      CREATEDITMESSAGEDETAIL:'/businessMessage/userCreatEditMessageDetail.ajax',
      CREATEDEDITMESSAGE:'/businessMessage/userCreatEditMessage.ajax',
      GET_WXMESSAGE:'/weixin/getWXSignMessage.ajax',
      GET_WXOPENID:'/weixin/getOpenId.ajax'
    }];

    this.getUrl = function (param) {
      return (servers[CONFIG.environment]['dataServer'] + urls[CONFIG.environment][param]);
    };

    this.getImageUrl = function (param) {
      return (servers[CONFIG.environment]['imageServer'] + param);
    };

    this.getUploadImageServer = function () {
      return (servers[CONFIG.environment]['uploadImageServer']);
    };

    this.getServer = function (param) {
      return servers[CONFIG.environment][param];
    }

  }])
;

